package duotaitest1;

public class Person {
    private String name;
    private int age;

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void keeppet(Animal a,String something){

        if(a instanceof Dog ){
            System.out.println("年龄为"+getAge()+"岁的"+getName()+"养了一只"
                    +a.getColour()+"的"+a.getAge()+"岁的狗");
//            d.eat("骨头");
            System.out.println(a.getColour()+"的"+a.getAge()+"岁的狗死死地抱着"+something+"猛吃");
        }
        else if(a instanceof Cat ){
            System.out.println("年龄为"+getAge()+"岁的"+getName()+"养了一只"
                    +a.getColour()+"的"+a.getAge()+"岁的猫");
//            c.eat("鱼");
            System.out.println(a.getColour()+"的"+a.getAge()+"岁的猫眯着眼睛侧着头吃"+something);
        }
        else{
            System.out.println("没有这种动物");
        }
    }
//    public void keeppet2(Animal a,String something,Dog d){
//        System.out.println(a.getColour()+"的"+a.getAge()+"岁的"+d.name+"死死地抱着"+something+"猛吃");
//    }
}
